// 封装所有和用户相关的接口函数
import request from '@/utils/request'
import type {
  TechnicalListData,
  ProjectAdd,
  ProjectEdit,
  Id,
  AIResult,
} from './type'

// 首页列表
export function projectList(data: TechnicalListData) {
  return request({
    url: '/manager/investment/technical/list',
    method: 'POST',
    data,
  })
}

// 新增
export function projectAdd(data: ProjectAdd) {
  return request({
    url: '/manager/investment/technical/save',
    method: 'POST',
    data,
  })
}
// 编辑
export function projectEdit(data: ProjectEdit) {
  return request({
    url: '/manager/investment/technical/update',
    method: 'POST',
    data,
  })
}

// 详情
export function projectDetail(data: Id) {
  return request({
    url: '/manager/investment/technical/detail',
    method: 'POST',
    data,
  })
}
// 执行AI分析
export function AIAnalysis(data: Id) {
  return request({
    url: '/manager/investment/technical/ai/execute',
    method: 'POST',
    data,
  })
}

// AI结果
export function AIResult(data: Id) {
  return request({
    url: '/manager/investment/technical/ai/detail',
    method: 'POST',
    data,
  })
}

// 编辑AI生成结果
export function editAIResult(data: any) {
  return request({
    url: '/manager/investment/technical/ai/update',
    method: 'POST',
    data,
  })
}

// 导出模板
export function exportDocx(data: Id) {
  return request({
    url: '/manager/investment/file/docx',
    method: 'POST',
    data,
  })
}

// 删除
export function projectDelete(data: Id) {
  return request({
    url: '/manager/investment/technical/delete',
    method: 'POST',
    data,
  })
}
